import React from 'react'
import './chart.scss'
import ECharts from '../echarts';
import { useSelector } from 'react-redux'

function Chart({ header, main }) {
    const languages = useSelector((state) => state.publicReducer.language)
    return (
        <div className="Chart">
            <div className="data">
                <figure>{header}</figure>
                <figcaption>{main}{main && <span>{languages === "Korean" ? "원" : (languages === "Chinese" ? "元" : "$")}</span>}</figcaption>
            </div>
            <ECharts></ECharts>
        </div>
    )
}

export default Chart